Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
projvar
- Project Variables
A CLI (Command-line Interface) tool that extracts a base set of meta data properties from a given, digital project, using various sources.
Example scenarios
projvar
is designed to work best for git repositories,
both locally or on a CI (Continous Integration) system,
though it will also work (partly) for other projects.
Local project
The project needs to be present as a folder on the local file-system,
from which one runs projvar
,
which in turn writes the meta-data for that project into a file
# MY_PROJECT_PATH="$HOME/Projects/projvar"
PROJECT_BUILD_ARCH="x86_64"
PROJECT_BUILD_BRANCH="master"
PROJECT_BUILD_DATE="2021-12-25 12:50:50"
PROJECT_BUILD_HOSTING_URL="https://hoijui.github.io/projvar"
PROJECT_BUILD_OS="linux"
PROJECT_BUILD_OS_FAMILY="unix"
PROJECT_BUILD_TAG="0.8.0"
PROJECT_CI="false"
PROJECT_LICENSE="AGPL-3.0-only"
PROJECT_LICENSES="CC0-1.0, AGPL-3.0-or-later, Unlicense"
PROJECT_NAME="projvar"
PROJECT_NAME_MACHINE_READABLE="projvar"
PROJECT_REPO_CLONE_URL="https://github.com/hoijui/projvar.git"
PROJECT_REPO_CLONE_URL_SSH="ssh://git@github.com:hoijui/projvar.git"
PROJECT_REPO_COMMIT_PREFIX_URL="https://github.com/hoijui/projvar/commit"
PROJECT_REPO_ISSUES_URL="https://github.com/hoijui/projvar/issues"
PROJECT_REPO_RAW_VERSIONED_PREFIX_URL="https://raw.githubusercontent.com/hoijui/projvar"
PROJECT_REPO_VERSIONED_DIR_PREFIX_URL="https://github.com/hoijui/projvar/tree"
PROJECT_REPO_VERSIONED_FILE_PREFIX_URL="https://github.com/hoijui/projvar/blob"
PROJECT_REPO_WEB_URL="https://github.com/hoijui/projvar"
PROJECT_VERSION="0.8.0-dirty"
PROJECT_VERSION_DATE="2021-12-13 09:18:25"
In CI (build-bot)
- Check out your repo
- Run this tool (
projvar
)- it ensures a a few properties are known, for example:
PROJECT_NAME="My Project"
PROJECT_VERSION="my-proj-1.2.3-44-ge73gf28"
PROJECT_REPO_WEB_URL="https://github.com/user/my-proj"
- it stores them somehow, typically into a file,
using BASH
source
compatible syntax
- it ensures a a few properties are known, for example:
- Run some other tool that uses these environment variables. For example, you may include it in a QRCode, which you then print onto your project.
How to compile
You need to install Rust(lang) and Cargo.
Then get the whole repo plus git sub-modules with:
Then you can run:
If all goes well, the executable can be found at target/release/projvar
.
Get the tool
As for now, you have two choices:
- Compile it yourself
- Download a Linux x86_64 statically linked binary from the releases page
Usage
for
)
)
)
)
;
) )
;
) \
); \
)
)
) )
) )
)
The list of all supported keys/properties (as shown by --list
):
Default Required | Key | Description |
---|---|---|
[ ] | PROJECT_BUILD_ARCH |
The computer hardware architecture we are building on. (common values: 'x86', 'x86_64') |
[ ] | PROJECT_BUILD_BRANCH |
The development branch name, for example: "master", "develop" |
[ ] | PROJECT_BUILD_DATE |
Date of this build, for example: "2021-12-31 23:59:59" (see --date-format) |
[ ] | PROJECT_BUILD_HOSTING_URL |
Web URL under which the generated output will be available, for example: https://osegermany.gitlab.io/OHS-3105 |
[ ] | PROJECT_BUILD_NUMBER |
The build number (1, 2, 3) starts at 1 for each repo and branch. |
[ ] | PROJECT_BUILD_OS |
The operating system we are building on. (common values: 'linux', 'macos', 'windows') |
[ ] | PROJECT_BUILD_OS_FAMILY |
The operating system family we are building on. (should be either 'unix' or 'windows') |
[ ] | PROJECT_BUILD_TAG |
The tag of a commit that kicked off the build. This value is only available on tags. Not available for builds against branches. |
[ ] | PROJECT_CI |
'true' if running on a CI/build-bot; unset otherwise. |
[x] | PROJECT_LICENSE |
The main License identifier of the sources, preferably from the SPDX specs, for example: "AGPL-3.0-or-later", "CC-BY-SA-4.0" |
[x] | PROJECT_LICENSES |
The identifiers of all the licenses of this project, preferably from the SPDX specs, comma separated, for example: "AGPL-3.0-or-later, CC0-1.0, Unlicense" |
[x] | PROJECT_NAME |
The human focused name of the project. |
[x] | PROJECT_NAME_MACHINE_READABLE |
The machine readable name of the project. |
[x] | PROJECT_REPO_CLONE_URL |
The original repo clone URL; may use any valid git URL scheme. May not conform to the URL specification. It is commonly used for anonymous fetch-only access. |
[ ] | PROJECT_REPO_CLONE_URL_HTTP |
The repo clone URL, HTTP(S) version. It always conforms to the URL specification. It is commonly used for anonymous fetch-only access. |
[ ] | PROJECT_REPO_CLONE_URL_SSH |
The repo clone URL, SSH version. It always conforms to the URL specification. It is commonly used for authenticated, fetch and push access. |
[x] | PROJECT_REPO_COMMIT_PREFIX_URL |
The repo commit prefix URL. Add commit SHA. The part in []: [https://github.com/hoijui/nim-ci/commit]/23f84b91] |
[x] | PROJECT_REPO_ISSUES_URL |
The repo issues URL, for example: https://gitlab.com/openflexure/openflexure-microscope/issues |
[x] | PROJECT_REPO_RAW_VERSIONED_PREFIX_URL |
The repo raw prefix URL. Add version (tag, branch, SHA) and file path. The part in []: [https://raw.githubusercontent.com/hoijui/nim-ci]/master/.github/workflows/docker.yml] |
[x] | PROJECT_REPO_VERSIONED_DIR_PREFIX_URL |
The repo directory prefix URL. Add version (tag, branch, SHA) and directory path. The part in []: [https://github.com/hoijui/nim-ci]/master/.github/workflows/docker.yml] |
[x] | PROJECT_REPO_VERSIONED_FILE_PREFIX_URL |
The repo file prefix URL. Add version (tag, branch, SHA) and file path. The part in []: [https://github.com/hoijui/nim-ci]/master/.github/workflows/docker.yml] |
[x] | PROJECT_REPO_WEB_URL |
The repo web UI URL, for example: https://gitlab.com/OSEGermany/OHS-3105 |
[x] | PROJECT_VERSION |
The project version, for example: "1.10.3", "0.2.0-1-ga5387ac-dirty" |
[x] | PROJECT_VERSION_DATE |
Date this version was committed to source control, for example: "2021-12-31 23:59:59" (see --date-format) |
Funding
This project was funded by the European Regional Development Fund (ERDF) in the context of the INTERFACER Project, from August 2021 (project start) until March 2023.